package com.bjt.wms.sys.service;

import com.bjt.common.config.paragetter.BasePageRequest;
import com.bjt.utils.R;
import com.bjt.wms.sys.model.Stock;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.activerecord.SqlPara;

public class StockService {
    public R queryStockList(BasePageRequest<Stock> basePageRequest) {
        SqlPara sqlPara = Db.getSqlPara("sys.stock.queryList");

        Page<Record> pageData = Db.paginate(basePageRequest.getPage(), basePageRequest.getLimit(), sqlPara);
        return R.ok().put("data", pageData.getList()).put("count", pageData.getTotalRow());
    }

}
